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

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

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

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

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

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

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

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

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

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

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

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

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

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

c.p = k
c.s = k
c.y = m
a.s = k
a.z = k
a.y = k
a.o = j
k.z = e
j.z = m
j.o = m
j.y = k
j.v = a
j.w = e
e.o = k
e.r = m
m.y = k
m.v = a
assert j.y.z.o.z.o.txt == "k"