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

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.z: C = None
        self.p: F = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

b.r = g
b.u = a
a.o = d
a.x = j
a.s = i
d.t = b
d.q = j
d.z = e
d.p = g
d.w = a
d.u = a
i.x = a
i.u = j
j.o = f
j.x = i
f.o = i
e.t = b
e.q = j
e.z = d
e.p = f
e.w = a
e.u = a
g.o = h
h.x = a
h.u = j
assert b.u.x.x.x.x.x.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.u: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: A = None
        self.q: E = None
        self.z: C = None
        self.p: F = None
        self.w: B = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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