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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.w: F = None
        self.x: E = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: B = None
        self.y: C = None
        self.w: F = None
        self.x: E = None
        self.txt = txt

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

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