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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

k = A("k")
g = B("g")
j = C("j")
c = D("c")
i = E("i")
f = F("f")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.q: B = None
        self.z: C = None
        self.t: C = None
        self.txt = txt

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

k = A("k")
g = B("g")
j = C("j")
c = D("c")
i = E("i")
f = F("f")

k.t = f
g.q = i
g.y = k
g.r = f
j.r = k
j.u = k
j.s = k
j.w = f
j.v = g
j.x = i
c.v = j
i.w = k
i.q = g
i.z = j
i.t = j
f.o = k
f.t = j
assert i.w.t.t.v.r.t.txt == "j"