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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.r: A = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: D = None
        self.r: A = None
        self.x: B = None
        self.p: E = None
        self.txt = txt

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

l.y = i
l.v = n
d.v = i
d.s = f
d.z = f
m.o = i
m.y = l
m.z = f
i.s = g
i.u = g
i.x = g
i.p = c
i.v = j
n.y = c
n.q = i
n.r = l
n.x = j
n.p = h
c.s = m
c.u = m
c.x = m
c.p = i
c.v = d
h.y = i
h.q = c
h.r = l
h.x = j
h.p = n
g.o = c
g.y = l
g.z = f
j.v = i
j.s = f
j.z = f
f.v = i
f.s = d
f.z = d
assert l.v.p.p.r.txt == "l"