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

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

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

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

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

d = A("d")
k = B("k")
c = C("c")
l = D("l")
j = E("j")
i = B("i")
a = C("a")

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

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

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

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

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

d = A("d")
k = B("k")
c = C("c")
l = D("l")
j = E("j")
i = B("i")
a = C("a")

d.w = i
d.x = i
d.t = a
d.s = c
d.o = j
k.r = d
c.q = l
c.y = l
c.u = j
l.o = j
l.r = c
j.p = c
j.o = d
i.r = d
a.q = l
a.y = l
a.u = j
assert l.r.y.r.q.o.p.txt == "c"