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

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

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

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

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

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

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

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

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

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

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

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

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

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

i.s = e
i.y = a
e.s = i
e.r = k
c.s = e
c.t = f
c.x = i
c.q = k
k.r = i
k.o = e
k.w = c
k.s = f
f.u = c
f.z = k
f.s = k
a.o = k
a.x = i
a.s = c
assert i.s.s.s.s.y.x.txt == "i"