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

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.s: E = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.s: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
c = C("c")
a = D("a")
b = E("b")
f = C("f")

l.o = a
l.r = m
l.t = b
l.q = b
m.p = l
m.x = l
m.y = b
m.s = b
m.q = b
c.w = f
c.s = f
c.z = b
a.x = b
b.x = l
b.y = l
b.w = a
b.t = c
b.u = m
f.w = c
f.s = c
f.z = b
assert a.x.w.x.u.y.y.txt == "
class A:
    def __init__(self, txt: str):
        self.o: D = None
        self.r: B = None
        self.t: E = None
        self.q: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: A = None
        self.y: E = None
        self.s: E = None
        self.q: E = None
        self.x: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: C = None
        self.z: E = None
        self.s: C = None
        self.txt = txt

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

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

l = A("l")
m = B("m")
c = C("c")
a = D("a")
b = E("b")
f = C("f")

l.o = a
l.r = m
l.t = b
l.q = b
m.p = l
m.x = l
m.y = b
m.s = b
m.q = b
c.w = f
c.s = f
c.z = b
a.x = b
b.x = l
b.y = l
b.w = a
b.t = c
b.u = m
f.w = c
f.s = c
f.z = b
assert a.x.w.x.u.y.y.txt == "l"