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

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

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

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

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

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

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

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

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

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

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

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

k.v = m
k.t = f
k.p = f
k.u = n
n.o = k
n.r = l
n.u = l
n.s = g
n.x = g
l.t = k
l.o = f
l.z = d
f.o = d
f.r = j
f.x = n
d.v = m
j.t = k
j.o = f
j.z = d
g.o = k
g.r = j
g.u = j
g.s = n
g.x = n
m.v = k
m.t = f
m.p = f
m.u = n
assert f.x.s.r.o.txt == "f"