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

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

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

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

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

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

c.q = l
c.p = l
c.o = l
c.y = b
b.v = m
b.w = l
n.z = i
n.o = f
f.r = b
f.t = m
f.p = m
l.w = i
l.x = b
l.q = c
l.y = h
j.q = l
j.p = l
j.o = l
j.y = m
h.r = b
h.p = b
h.t = m
m.v = b
m.w = l
e.q = l
e.p = l
e.o = l
e.y = m
i.z = n
i.o = h
assert i.o.r.w.y.p.v.txt == "
class A:
    def __init__(self, txt: str):
        self.q: E = None
        self.y: B = None
        self.p: E = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

c.q = l
c.p = l
c.o = l
c.y = b
b.v = m
b.w = l
n.z = i
n.o = f
f.r = b
f.t = m
f.p = m
l.w = i
l.x = b
l.q = c
l.y = h
j.q = l
j.p = l
j.o = l
j.y = m
h.r = b
h.p = b
h.t = m
m.v = b
m.w = l
e.q = l
e.p = l
e.o = l
e.y = m
i.z = n
i.o = h
assert i.o.r.w.y.p.v.txt == "m"