class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: C = None
        self.q: J = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.o: D = None
        self.t: A = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.q: A = None
        self.s: C = None
        self.x: E = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.r: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.z: E = None
        self.x: H = None
        self.o: I = None
        self.txt = txt

b = A("b")
a = B("a")
g = C("g")
d = D("d")
f = E("f")
j = F("j")
h = G("h")
i = H("i")
k = I("k")
n = J("n")

b.x = i
b.o = d
b.u = g
b.v = g
a.p = b
a.t = g
a.q = n
a.v = j
g.p = k
d.t = g
f.u = j
f.p = d
f.o = d
f.t = b
f.z = n
j.p = a
h.q = f
i.v = b
i.q = b
i.o = d
i.s = g
i.x = f
i.r = f
i.t = j
k.u = i
k.o = h
k.r = n
n.u = i
n.x = i
n.w = b
n.z = f
n.o = k
assert i.v.o.t.p.o.q.t.txt == "
class A:
    def __init__(self, txt: str):
        self.x: H = None
        self.o: D = None
        self.u: C = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: C = None
        self.q: J = None
        self.v: F = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.p: I = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.u: F = None
        self.p: D = None
        self.o: D = None
        self.t: A = None
        self.z: J = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.p: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: A = None
        self.o: D = None
        self.q: A = None
        self.s: C = None
        self.x: E = None
        self.r: E = None
        self.t: F = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.u: H = None
        self.o: G = None
        self.r: J = None
        self.txt = txt

class J:
    def __init__(self, txt: str):
        self.u: H = None
        self.w: A = None
        self.z: E = None
        self.x: H = None
        self.o: I = None
        self.txt = txt

b = A("b")
a = B("a")
g = C("g")
d = D("d")
f = E("f")
j = F("j")
h = G("h")
i = H("i")
k = I("k")
n = J("n")

b.x = i
b.o = d
b.u = g
b.v = g
a.p = b
a.t = g
a.q = n
a.v = j
g.p = k
d.t = g
f.u = j
f.p = d
f.o = d
f.t = b
f.z = n
j.p = a
h.q = f
i.v = b
i.q = b
i.o = d
i.s = g
i.x = f
i.r = f
i.t = j
k.u = i
k.o = h
k.r = n
n.u = i
n.x = i
n.w = b
n.z = f
n.o = k
assert i.v.o.t.p.o.q.t.txt == "b"