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

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

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

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

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

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

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

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

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

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

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

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

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