class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: B = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.v: C = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
f = D("f")
d = E("d")
c = C("c")
g = C("g")

l.y = d
l.w = e
l.v = e
l.t = g
e.t = l
b.r = e
b.u = e
b.x = c
b.v = c
b.o = l
f.t = g
d.r = e
d.p = e
d.q = f
d.s = g
c.r = e
c.u = e
c.x = g
c.v = b
c.o = l
g.r = e
g.u = e
g.x = b
g.v = b
g.o = l
assert c.x.v.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.y: E = None
        self.w: B = None
        self.t: C = None
        self.v: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.x: C = None
        self.v: C = None
        self.u: B = None
        self.o: A = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.p: B = None
        self.q: D = None
        self.s: C = None
        self.txt = txt

l = A("l")
e = B("e")
b = C("b")
f = D("f")
d = E("d")
c = C("c")
g = C("g")

l.y = d
l.w = e
l.v = e
l.t = g
e.t = l
b.r = e
b.u = e
b.x = c
b.v = c
b.o = l
f.t = g
d.r = e
d.p = e
d.q = f
d.s = g
c.r = e
c.u = e
c.x = g
c.v = b
c.o = l
g.r = e
g.u = e
g.x = b
g.v = b
g.o = l
assert c.x.v.u.t.txt == "l"