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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: D = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: E = None
        self.z: B = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: D = None
        self.o: A = None
        self.v: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: E = None
        self.z: B = None
        self.y: B = None
        self.s: E = None
        self.txt = txt

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

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

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

i.s = k
k.r = a
k.x = e
k.o = i
k.v = d
c.y = e
c.w = d
e.v = k
e.z = k
e.y = k
e.q = f
e.s = a
f.p = i
f.o = c
f.v = a
d.s = i
d.q = i
a.p = i
a.o = c
a.v = f
assert d.q.s.r.v.o.y.v.txt == "k"