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

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: E = None
        self.p: C = None
        self.r: F = None
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
b = C("b")
m = D("m")
a = E("a")
i = F("i")
d = D("d")
n = E("n")

f.y = b
f.v = k
f.s = n
k.v = i
k.r = i
k.t = a
k.p = b
k.y = d
k.z = n
b.z = m
b.u = i
m.z = f
m.t = b
m.u = n
a.w = k
a.s = d
a.v = i
i.q = m
i.w = f
i.y = k
i.p = n
d.z = f
d.t = b
d.u = a
n.w = k
n.s = m
n.v = i
assert d.u.s.u.v.txt == "
class A:
    def __init__(self, txt: str):
        self.y: C = None
        self.v: B = None
        self.s: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: F = None
        self.t: E = None
        self.p: C = None
        self.r: F = None
        self.y: D = None
        self.z: E = None
        self.txt = txt

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

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

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

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

f = A("f")
k = B("k")
b = C("b")
m = D("m")
a = E("a")
i = F("i")
d = D("d")
n = E("n")

f.y = b
f.v = k
f.s = n
k.v = i
k.r = i
k.t = a
k.p = b
k.y = d
k.z = n
b.z = m
b.u = i
m.z = f
m.t = b
m.u = n
a.w = k
a.s = d
a.v = i
i.q = m
i.w = f
i.y = k
i.p = n
d.z = f
d.t = b
d.u = a
n.w = k
n.s = m
n.v = i
assert d.u.s.u.v.txt == "i"