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

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.q: B = None
        self.z: D = None
        self.t: D = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

i = A("i")
j = B("j")
m = C("m")
g = D("g")
a = E("a")
n = F("n")
d = G("d")
l = C("l")
c = B("c")
k = A("k")

i.z = d
i.q = n
j.y = c
m.s = i
m.t = a
m.p = n
g.s = a
g.t = a
g.v = d
a.y = g
a.z = g
a.t = g
a.s = n
a.w = n
a.q = j
a.u = m
n.z = j
n.s = a
n.t = l
d.p = i
l.s = k
l.t = a
l.p = n
c.y = j
k.z = d
k.q = n
assert k.z.p.q.z.txt == "
class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.q: F = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.y: D = None
        self.s: F = None
        self.q: B = None
        self.z: D = None
        self.t: D = None
        self.w: F = None
        self.u: C = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.txt = txt

i = A("i")
j = B("j")
m = C("m")
g = D("g")
a = E("a")
n = F("n")
d = G("d")
l = C("l")
c = B("c")
k = A("k")

i.z = d
i.q = n
j.y = c
m.s = i
m.t = a
m.p = n
g.s = a
g.t = a
g.v = d
a.y = g
a.z = g
a.t = g
a.s = n
a.w = n
a.q = j
a.u = m
n.z = j
n.s = a
n.t = l
d.p = i
l.s = k
l.t = a
l.p = n
c.y = j
k.z = d
k.q = n
assert k.z.p.q.z.txt == "j"