class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: H = None
        self.r: J = None
        self.z: B = None
        self.w: A = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.p: I = None
        self.x: A = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: H = None
        self.z: H = None
        self.t: H = None
        self.x: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
f = C("f")
h = D("h")
c = E("c")
d = F("d")
e = G("e")
n = H("n")
k = I("k")
j = J("j")

m.x = k
m.t = b
m.v = h
b.o = e
b.r = f
b.v = k
f.t = e
f.x = e
f.y = n
f.r = j
f.z = b
f.w = m
f.o = d
h.p = e
h.q = k
c.y = e
d.t = j
e.w = c
e.t = j
n.z = c
n.q = h
n.y = h
n.p = k
n.x = m
n.t = f
k.v = j
k.y = n
k.z = n
k.t = n
k.x = f
j.z = c
j.p = c
j.s = f
j.t = f
j.v = h
j.u = d
assert d.t.t.w.v.q.t.t.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.x: I = None
        self.t: B = None
        self.v: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: G = None
        self.r: C = None
        self.v: I = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: G = None
        self.y: H = None
        self.r: J = None
        self.z: B = None
        self.w: A = None
        self.x: G = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.p: G = None
        self.q: I = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.t: J = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: J = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: E = None
        self.q: D = None
        self.p: I = None
        self.x: A = None
        self.t: C = None
        self.y: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.v: J = None
        self.y: H = None
        self.z: H = None
        self.t: H = None
        self.x: C = None
        self.txt = txt

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

m = A("m")
b = B("b")
f = C("f")
h = D("h")
c = E("c")
d = F("d")
e = G("e")
n = H("n")
k = I("k")
j = J("j")

m.x = k
m.t = b
m.v = h
b.o = e
b.r = f
b.v = k
f.t = e
f.x = e
f.y = n
f.r = j
f.z = b
f.w = m
f.o = d
h.p = e
h.q = k
c.y = e
d.t = j
e.w = c
e.t = j
n.z = c
n.q = h
n.y = h
n.p = k
n.x = m
n.t = f
k.v = j
k.y = n
k.z = n
k.t = n
k.x = f
j.z = c
j.p = c
j.s = f
j.t = f
j.v = h
j.u = d
assert d.t.t.w.v.q.t.t.y.q.txt == "h"