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

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.u: F = None
        self.y: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

d.v = m
d.y = m
j.t = m
k.v = l
k.s = i
k.r = i
k.u = m
k.y = m
k.z = d
l.t = m
l.u = k
l.v = d
i.r = j
i.p = d
i.x = k
i.s = l
m.t = d
assert m.t.y.t.v.t.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.y: F = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: D = None
        self.s: E = None
        self.u: F = None
        self.y: F = None
        self.z: A = None
        self.r: E = None
        self.txt = txt

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

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

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

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

d.v = m
d.y = m
j.t = m
k.v = l
k.s = i
k.r = i
k.u = m
k.y = m
k.z = d
l.t = m
l.u = k
l.v = d
i.r = j
i.p = d
i.x = k
i.s = l
m.t = d
assert m.t.y.t.v.t.txt == "d"