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

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

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

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

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

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

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

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

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

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

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