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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.x: F = None
        self.q: F = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.v: A = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: F = None
        self.o: E = None
        self.x: F = None
        self.q: F = None
        self.u: D = None
        self.y: C = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.w: A = None
        self.z: F = None
        self.v: A = None
        self.s: E = None
        self.r: E = None
        self.txt = txt

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

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

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

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