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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.v: F = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

f = A("f")
d = B("d")
b = C("b")
c = D("c")
j = E("j")
a = F("a")
k = C("k")

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: E = None
        self.v: F = None
        self.q: D = None
        self.u: D = None
        self.txt = txt

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

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

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

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

f = A("f")
d = B("d")
b = C("b")
c = D("c")
j = E("j")
a = F("a")
k = C("k")

f.s = d
d.s = f
d.w = j
d.v = a
d.q = c
d.u = c
b.s = j
b.y = k
b.o = k
c.x = j
c.z = b
j.o = d
a.p = c
a.t = d
a.w = d
a.x = j
a.s = f
k.s = j
k.y = b
k.o = b
assert a.t.v.x.o.txt == "d"