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

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

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

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

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

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

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

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

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

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

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

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

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

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

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