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

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.x: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: E = None
        self.r: C = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
h = C("h")
e = D("e")
m = E("m")
f = F("f")
l = B("l")
d = B("d")
i = F("i")
n = B("n")

k.v = i
c.w = h
c.t = h
c.x = f
c.z = e
h.v = m
h.q = d
h.u = n
h.s = k
e.z = m
e.x = m
e.r = h
e.w = h
e.v = f
m.s = k
m.w = i
m.v = h
m.t = d
f.q = n
l.w = h
l.t = h
l.x = f
l.z = e
d.w = h
d.t = h
d.x = f
d.z = e
i.q = l
n.w = h
n.t = h
n.x = f
n.z = e
assert n.w.v.t.t.u.z.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: C = None
        self.t: C = None
        self.x: F = None
        self.z: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.z: E = None
        self.x: E = None
        self.r: C = None
        self.w: C = None
        self.v: F = None
        self.txt = txt

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

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

k = A("k")
c = B("c")
h = C("h")
e = D("e")
m = E("m")
f = F("f")
l = B("l")
d = B("d")
i = F("i")
n = B("n")

k.v = i
c.w = h
c.t = h
c.x = f
c.z = e
h.v = m
h.q = d
h.u = n
h.s = k
e.z = m
e.x = m
e.r = h
e.w = h
e.v = f
m.s = k
m.w = i
m.v = h
m.t = d
f.q = n
l.w = h
l.t = h
l.x = f
l.z = e
d.w = h
d.t = h
d.x = f
d.z = e
i.q = l
n.w = h
n.t = h
n.x = f
n.z = e
assert n.w.v.t.t.u.z.txt == "e"