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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

a = A("a")
n = B("n")
f = C("f")
k = D("k")
d = E("d")
g = F("g")
i = A("i")
h = D("h")
j = B("j")
l = E("l")

a.t = f
a.u = d
a.v = l
a.z = k
n.q = g
n.u = j
f.t = i
k.v = h
k.t = a
k.z = f
d.u = a
d.x = j
d.w = n
d.r = f
g.q = h
g.z = h
g.u = n
i.t = f
i.u = d
i.v = l
i.z = h
h.v = k
h.t = a
h.z = f
j.q = g
j.u = n
l.u = a
l.x = j
l.w = j
l.r = f
assert n.q.z.v.z.t.u.txt == "
class A:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: E = None
        self.v: E = None
        self.z: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: B = None
        self.w: B = None
        self.r: C = None
        self.txt = txt

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

a = A("a")
n = B("n")
f = C("f")
k = D("k")
d = E("d")
g = F("g")
i = A("i")
h = D("h")
j = B("j")
l = E("l")

a.t = f
a.u = d
a.v = l
a.z = k
n.q = g
n.u = j
f.t = i
k.v = h
k.t = a
k.z = f
d.u = a
d.x = j
d.w = n
d.r = f
g.q = h
g.z = h
g.u = n
i.t = f
i.u = d
i.v = l
i.z = h
h.v = k
h.t = a
h.z = f
j.q = g
j.u = n
l.u = a
l.x = j
l.w = j
l.r = f
assert n.q.z.v.z.t.u.txt == "d"