class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.w: D = None
        self.z: E = None
        self.s: G = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

g = A("g")
d = B("d")
j = C("j")
c = D("c")
h = E("h")
k = F("k")
e = G("e")

g.t = k
g.y = h
g.z = h
g.x = h
g.w = c
g.s = e
g.o = d
d.y = g
d.t = g
j.z = e
c.t = k
c.r = k
c.x = h
c.s = e
c.u = g
c.q = j
h.u = d
k.u = e
e.w = h
e.p = k
e.t = c
assert c.t.u.p.u.t.x.txt == "
class A:
    def __init__(self, txt: str):
        self.t: F = None
        self.y: E = None
        self.w: D = None
        self.z: E = None
        self.s: G = None
        self.o: B = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.t: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

g = A("g")
d = B("d")
j = C("j")
c = D("c")
h = E("h")
k = F("k")
e = G("e")

g.t = k
g.y = h
g.z = h
g.x = h
g.w = c
g.s = e
g.o = d
d.y = g
d.t = g
j.z = e
c.t = k
c.r = k
c.x = h
c.s = e
c.u = g
c.q = j
h.u = d
k.u = e
e.w = h
e.p = k
e.t = c
assert c.t.u.p.u.t.x.txt == "h"