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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: F = None
        self.v: A = None
        self.x: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: B = None
        self.u: F = None
        self.r: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.r: D = None
        self.p: E = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

c = A("c")
n = B("n")
k = C("k")
a = D("a")
h = E("h")
l = F("l")
m = A("m")
d = F("d")

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

class B:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: F = None
        self.v: A = None
        self.x: E = None
        self.z: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.z: B = None
        self.u: F = None
        self.r: D = None
        self.p: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.s: F = None
        self.y: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: B = None
        self.r: D = None
        self.p: E = None
        self.z: B = None
        self.t: C = None
        self.txt = txt

c = A("c")
n = B("n")
k = C("k")
a = D("a")
h = E("h")
l = F("l")
m = A("m")
d = F("d")

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