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

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

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

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

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

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

k = A("k")
e = B("e")
m = C("m")
n = D("n")
a = E("a")
j = F("j")

k.p = m
k.o = a
e.p = k
e.s = a
e.t = a
m.u = k
m.v = a
m.p = a
m.s = j
m.t = n
n.z = m
n.y = a
n.o = a
a.v = m
a.t = m
a.q = e
a.y = n
a.s = n
a.z = j
j.v = a
j.p = e
j.q = m
assert a.q.s.s.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.o: E = None
        self.txt = txt

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

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

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

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

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

k = A("k")
e = B("e")
m = C("m")
n = D("n")
a = E("a")
j = F("j")

k.p = m
k.o = a
e.p = k
e.s = a
e.t = a
m.u = k
m.v = a
m.p = a
m.s = j
m.t = n
n.z = m
n.y = a
n.o = a
a.v = m
a.t = m
a.q = e
a.y = n
a.s = n
a.z = j
j.v = a
j.p = e
j.q = m
assert a.q.s.s.txt == "n"