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

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

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

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

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

c = A("c")
l = B("l")
n = C("n")
h = D("h")
m = E("m")
j = C("j")
g = A("g")
d = B("d")
k = A("k")

c.t = j
c.x = m
c.o = h
l.v = h
l.s = d
l.y = d
n.p = m
h.x = j
m.s = h
m.r = j
m.o = n
j.p = m
g.t = j
g.x = m
g.o = h
d.v = h
d.s = l
d.y = l
k.t = n
k.x = m
k.o = h
assert c.t.p.o.p.s.x.p.r.p.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.x: E = None
        self.o: D = None
        self.txt = txt

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

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

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

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

c = A("c")
l = B("l")
n = C("n")
h = D("h")
m = E("m")
j = C("j")
g = A("g")
d = B("d")
k = A("k")

c.t = j
c.x = m
c.o = h
l.v = h
l.s = d
l.y = d
n.p = m
h.x = j
m.s = h
m.r = j
m.o = n
j.p = m
g.t = j
g.x = m
g.o = h
d.v = h
d.s = l
d.y = l
k.t = n
k.x = m
k.o = h
assert c.t.p.o.p.s.x.p.r.p.txt == "m"