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

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

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

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

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

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

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

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

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

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

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

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

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

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

i.z = m
i.u = n
e.z = g
e.q = l
m.q = l
g.t = i
g.s = l
f.t = k
f.z = g
n.v = k
n.x = h
n.y = i
k.t = f
k.z = g
h.z = g
h.q = l
l.q = m
assert h.z.t.u.x.z.s.txt == "l"