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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.t: B = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: F = None
        self.p: A = None
        self.r: H = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: C = None
        self.w: G = None
        self.y: A = None
        self.t: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: G = None
        self.t: B = None
        self.z: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.z: F = None
        self.p: A = None
        self.r: H = None
        self.x: B = None
        self.u: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.u: D = None
        self.txt = txt

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

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