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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: C = None
        self.p: C = None
        self.w: C = None
        self.v: E = None
        self.txt = txt

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

i.o = f
i.x = n
i.u = d
l.q = a
l.r = k
n.r = j
j.y = f
j.v = a
k.y = n
k.p = n
k.w = n
k.v = c
a.y = f
a.v = j
c.y = n
c.p = n
c.w = n
c.v = k
f.o = i
f.x = n
f.u = d
d.q = j
d.r = c
m.q = j
m.r = k
assert i.x.r.v.txt == "a"