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

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

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

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

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

e = A("e")
f = B("f")
l = C("l")
g = D("g")
j = E("j")
n = C("n")
i = E("i")
a = C("a")
k = B("k")
d = A("d")

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

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

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

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

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

e = A("e")
f = B("f")
l = C("l")
g = D("g")
j = E("j")
n = C("n")
i = E("i")
a = C("a")
k = B("k")
d = A("d")

e.r = d
e.q = k
e.p = f
f.x = k
f.v = g
l.o = d
l.s = g
l.r = j
g.x = d
g.u = i
j.x = n
j.o = g
n.o = e
n.s = g
n.r = i
i.x = a
i.o = g
a.o = e
a.s = g
a.r = i
k.x = f
k.v = g
d.r = e
d.q = k
d.p = f
assert i.x.r.x.r.txt == "i"