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

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

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

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

e = A("e")
n = B("n")
m = C("m")
j = D("j")
k = C("k")
b = B("b")
f = B("f")
l = A("l")
i = C("i")
a = A("a")

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

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

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

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

e = A("e")
n = B("n")
m = C("m")
j = D("j")
k = C("k")
b = B("b")
f = B("f")
l = A("l")
i = C("i")
a = A("a")

e.o = j
e.r = n
e.p = b
n.u = f
n.v = i
n.s = i
n.o = j
m.r = e
m.x = j
m.v = f
m.t = n
j.s = a
j.z = a
k.r = l
k.x = j
k.v = f
k.t = n
b.u = f
b.v = k
b.s = k
b.o = j
f.u = n
f.v = k
f.s = m
f.o = j
l.o = j
l.r = n
l.p = f
i.r = a
i.x = j
i.v = n
i.t = n
a.o = j
a.r = f
a.p = n
assert k.x.z.r.txt == "f"