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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

k.r = f
k.p = m
j.o = k
i.y = e
i.t = k
n.s = j
n.w = a
n.z = m
a.w = k
a.t = i
e.s = j
e.t = c
m.r = e
m.p = k
f.s = j
f.t = c
c.s = j
c.w = a
c.z = m
assert c.s.o.r.s.o.p.p.txt == "
class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.p: A = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: D = None
        self.txt = txt

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

k.r = f
k.p = m
j.o = k
i.y = e
i.t = k
n.s = j
n.w = a
n.z = m
a.w = k
a.t = i
e.s = j
e.t = c
m.r = e
m.p = k
f.s = j
f.t = c
c.s = j
c.w = a
c.z = m
assert c.s.o.r.s.o.p.p.txt == "k"