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

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.x: F = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.p: D = None
        self.q: D = None
        self.z: A = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

i.u = k
k.r = i
k.u = i
d.y = h
d.q = h
d.x = g
d.v = k
e.o = h
e.q = d
e.r = g
c.w = d
c.x = d
c.r = b
c.z = i
g.x = e
g.v = d
b.s = d
b.y = g
b.p = e
b.q = e
b.o = e
b.r = e
b.z = i
h.x = g
assert c.z.u.u.u.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.y: H = None
        self.q: H = None
        self.x: F = None
        self.v: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.q: C = None
        self.r: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: C = None
        self.x: C = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.y: F = None
        self.p: D = None
        self.q: D = None
        self.z: A = None
        self.o: D = None
        self.r: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.txt = txt

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

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