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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: A = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: B = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.x: A = None
        self.p: C = None
        self.r: B = None
        self.txt = txt

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

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