class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: G = None
        self.t: A = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: G = None
        self.o: C = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.s: D = None
        self.u: G = None
        self.t: A = None
        self.p: E = None
        self.x: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
d = C("d")
f = D("f")
e = E("e")
m = F("m")
b = G("b")
j = D("j")

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

class B:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: G = None
        self.t: A = None
        self.z: A = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.t: B = None
        self.r: G = None
        self.o: C = None
        self.w: E = None
        self.s: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: C = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: C = None
        self.r: B = None
        self.s: D = None
        self.u: G = None
        self.t: A = None
        self.p: E = None
        self.x: A = None
        self.txt = txt

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

h = A("h")
k = B("k")
d = C("d")
f = D("f")
e = E("e")
m = F("m")
b = G("b")
j = D("j")

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