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

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.y: C = None
        self.x: B = None
        self.txt = txt

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

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

c = A("c")
m = B("m")
l = C("l")
n = D("n")
k = E("k")
e = B("e")
i = D("i")
f = C("f")
b = B("b")
d = B("d")

c.r = i
c.p = f
m.v = i
m.t = i
m.x = d
m.w = d
m.y = f
l.u = m
l.p = b
l.x = b
l.y = f
n.u = m
n.o = k
k.p = i
e.v = i
e.t = i
e.x = m
e.w = m
e.y = f
i.u = e
i.o = k
f.u = d
f.x = d
f.p = e
f.y = l
b.v = n
b.x = d
b.w = m
b.y = f
b.t = i
d.v = i
d.x = m
d.w = b
d.y = f
d.t = n
assert c.p.p.t.o.p.o.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.p: B = None
        self.y: C = None
        self.x: B = None
        self.txt = txt

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

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

c = A("c")
m = B("m")
l = C("l")
n = D("n")
k = E("k")
e = B("e")
i = D("i")
f = C("f")
b = B("b")
d = B("d")

c.r = i
c.p = f
m.v = i
m.t = i
m.x = d
m.w = d
m.y = f
l.u = m
l.p = b
l.x = b
l.y = f
n.u = m
n.o = k
k.p = i
e.v = i
e.t = i
e.x = m
e.w = m
e.y = f
i.u = e
i.o = k
f.u = d
f.x = d
f.p = e
f.y = l
b.v = n
b.x = d
b.w = m
b.y = f
b.t = i
d.v = i
d.x = m
d.w = b
d.y = f
d.t = n
assert c.p.p.t.o.p.o.p.txt == "i"