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

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

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

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

k.s = f
k.x = f
k.q = m
f.s = d
f.u = k
f.y = m
f.x = i
i.y = f
i.t = a
i.s = a
d.q = k
d.z = m
d.x = m
a.z = f
a.w = d
m.s = a
m.p = k
m.r = j
m.o = d
j.s = a
j.p = k
j.r = m
j.o = d
assert i.t.z.u.s.txt == "
class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.x: B = None
        self.q: F = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.q: A = None
        self.z: F = None
        self.x: F = None
        self.txt = txt

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

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

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

k.s = f
k.x = f
k.q = m
f.s = d
f.u = k
f.y = m
f.x = i
i.y = f
i.t = a
i.s = a
d.q = k
d.z = m
d.x = m
a.z = f
a.w = d
m.s = a
m.p = k
m.r = j
m.o = d
j.s = a
j.p = k
j.r = m
j.o = d
assert i.t.z.u.s.txt == "f"