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

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

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

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

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

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

f = A("f")
k = B("k")
i = C("i")
g = D("g")
a = E("a")
l = F("l")
b = B("b")

f.t = b
f.q = l
f.v = g
f.w = g
k.t = a
i.u = k
i.t = f
g.o = a
g.q = a
a.u = g
a.s = i
l.o = i
l.u = f
b.t = a
assert i.t.t.t.s.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: B = None
        self.q: F = None
        self.v: D = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

f = A("f")
k = B("k")
i = C("i")
g = D("g")
a = E("a")
l = F("l")
b = B("b")

f.t = b
f.q = l
f.v = g
f.w = g
k.t = a
i.u = k
i.t = f
g.o = a
g.q = a
a.u = g
a.s = i
l.o = i
l.u = f
b.t = a
assert i.t.t.t.s.u.txt == "k"