class A:
    def __init__(self, txt: str):
        self.p: A = None
        self.w: D = None
        self.y: D = None
        self.s: D = None
        self.u: B = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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