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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: F = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: F = None
        self.v: E = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

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