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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

i = A("i")
g = B("g")
m = C("m")
l = D("l")
k = E("k")
c = F("c")
d = E("d")

i.t = l
g.w = k
m.u = d
l.t = d
l.s = g
k.o = m
k.y = m
k.p = d
k.v = i
c.u = d
d.o = m
d.y = m
d.p = k
d.v = i
assert c.u.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.u: E = None
        self.txt = txt

i = A("i")
g = B("g")
m = C("m")
l = D("l")
k = E("k")
c = F("c")
d = E("d")

i.t = l
g.w = k
m.u = d
l.t = d
l.s = g
k.o = m
k.y = m
k.p = d
k.v = i
c.u = d
d.o = m
d.y = m
d.p = k
d.v = i
assert c.u.v.t.txt == "l"