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

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.y: B = None
        self.w: B = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

l = A("l")
h = B("h")
a = C("a")
d = D("d")
e = E("e")
i = F("i")
b = C("b")
g = F("g")

l.x = a
l.t = e
h.p = d
h.u = a
h.x = l
a.y = e
a.o = b
d.q = h
e.s = a
e.p = h
e.y = h
e.w = h
e.x = h
e.o = d
i.x = e
i.t = l
i.z = l
i.y = g
i.o = h
b.y = e
b.o = a
g.x = e
g.t = l
g.z = l
g.y = i
g.o = h
assert g.t.t.y.u.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.x: C = None
        self.t: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: C = None
        self.p: B = None
        self.y: B = None
        self.w: B = None
        self.x: B = None
        self.o: D = None
        self.txt = txt

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

l = A("l")
h = B("h")
a = C("a")
d = D("d")
e = E("e")
i = F("i")
b = C("b")
g = F("g")

l.x = a
l.t = e
h.p = d
h.u = a
h.x = l
a.y = e
a.o = b
d.q = h
e.s = a
e.p = h
e.y = h
e.w = h
e.x = h
e.o = d
i.x = e
i.t = l
i.z = l
i.y = g
i.o = h
b.y = e
b.o = a
g.x = e
g.t = l
g.z = l
g.y = i
g.o = h
assert g.t.t.y.u.y.w.txt == "h"