class A:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

i.u = h
c.v = d
c.o = k
c.r = h
m.y = c
m.w = d
m.z = n
j.p = k
j.r = d
j.v = c
g.x = c
g.z = h
h.p = k
h.r = n
h.v = c
n.y = c
n.w = d
n.z = m
d.y = k
d.w = m
d.z = n
b.x = k
b.z = h
k.v = n
k.o = c
k.r = h
assert i.u.r.y.r.p.o.o.v.w.txt == "d"