class A:
    def __init__(self, txt: str):
        self.q: D = None
        self.p: C = None
        self.v: C = None
        self.t: C = None
        self.x: D = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: A = None
        self.u: E = None
        self.t: B = None
        self.txt = txt

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

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

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

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