class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

l = A("l")
d = B("d")
j = C("j")
e = D("e")
g = E("g")
c = D("c")
m = D("m")

l.w = g
d.o = j
j.v = d
j.o = d
j.u = g
j.s = g
j.q = l
e.u = c
e.o = l
e.p = l
e.v = d
g.x = e
c.u = e
c.o = l
c.p = l
c.v = d
m.u = c
m.o = l
m.p = l
m.v = d
assert e.p.w.x.u.u.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.u: D = None
        self.o: A = None
        self.p: A = None
        self.v: B = None
        self.txt = txt

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

l = A("l")
d = B("d")
j = C("j")
e = D("e")
g = E("g")
c = D("c")
m = D("m")

l.w = g
d.o = j
j.v = d
j.o = d
j.u = g
j.s = g
j.q = l
e.u = c
e.o = l
e.p = l
e.v = d
g.x = e
c.u = e
c.o = l
c.p = l
c.v = d
m.u = c
m.o = l
m.p = l
m.v = d
assert e.p.w.x.u.u.txt == "e"