class A:
    def __init__(self, txt: str):
        self.v: C = None
        self.p: A = None
        self.s: A = None
        self.t: B = None
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: C = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.w: A = None
        self.x: B = None
        self.txt = txt

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

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