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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.q: C = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.t: E = None
        self.q: C = None
        self.s: C = None
        self.p: C = None
        self.txt = txt

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

n.r = j
n.p = b
b.v = f
b.x = g
b.z = g
b.s = g
b.u = n
f.o = b
f.w = m
f.p = g
f.s = n
g.u = f
g.p = f
m.v = f
m.q = f
m.s = f
m.p = f
m.t = k
l.r = n
l.p = i
k.v = f
k.q = f
k.s = f
k.p = f
k.t = h
i.v = f
i.x = g
i.z = g
i.s = g
i.u = l
j.r = l
j.p = i
h.v = f
h.q = f
h.s = f
h.p = f
h.t = m
assert b.v.w.v.txt == "f"