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

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

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

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

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

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

j = A("j")
b = B("b")
g = C("g")
l = D("l")
i = E("i")
m = F("m")
e = B("e")

j.q = m
j.u = g
b.o = l
b.t = l
b.u = j
b.p = m
b.z = g
g.t = j
l.v = i
l.x = m
i.x = e
m.p = j
m.r = g
m.x = g
m.t = l
m.u = i
e.o = l
e.t = l
e.u = j
e.p = m
e.z = g
assert j.q.t.x.p.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: C = None
        self.txt = txt

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

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

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

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

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

j = A("j")
b = B("b")
g = C("g")
l = D("l")
i = E("i")
m = F("m")
e = B("e")

j.q = m
j.u = g
b.o = l
b.t = l
b.u = j
b.p = m
b.z = g
g.t = j
l.v = i
l.x = m
i.x = e
m.p = j
m.r = g
m.x = g
m.t = l
m.u = i
e.o = l
e.t = l
e.u = j
e.p = m
e.z = g
assert j.q.t.x.p.u.t.txt == "j"