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

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: C = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.t: B = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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

d.x = l
d.p = k
d.s = m
d.v = n
f.r = c
f.y = c
f.x = k
f.v = n
c.u = k
c.p = a
m.y = a
m.z = f
m.t = f
m.w = c
m.v = c
l.r = n
l.q = k
l.z = k
l.u = f
n.x = l
n.p = k
n.s = b
n.v = d
k.r = c
k.y = c
k.x = f
k.v = d
j.r = n
j.q = f
j.z = f
j.u = k
a.r = d
a.q = f
a.z = f
a.u = k
b.y = a
b.z = f
b.t = f
b.w = c
b.v = c
assert m.y.r.p.v.v.x.q.x.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: B = None
        self.s: D = None
        self.v: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: C = None
        self.y: C = None
        self.x: B = None
        self.v: A = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: B = None
        self.t: B = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

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

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

d.x = l
d.p = k
d.s = m
d.v = n
f.r = c
f.y = c
f.x = k
f.v = n
c.u = k
c.p = a
m.y = a
m.z = f
m.t = f
m.w = c
m.v = c
l.r = n
l.q = k
l.z = k
l.u = f
n.x = l
n.p = k
n.s = b
n.v = d
k.r = c
k.y = c
k.x = f
k.v = d
j.r = n
j.q = f
j.z = f
j.u = k
a.r = d
a.q = f
a.z = f
a.u = k
b.y = a
b.z = f
b.t = f
b.w = c
b.v = c
assert m.y.r.p.v.v.x.q.x.txt == "f"