class A:
    def __init__(self, txt: str):
        self.z: C = None
        self.w: G = None
        self.r: G = None
        self.y: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: G = None
        self.u: B = None
        self.q: B = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

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

n = A("n")
g = B("g")
k = C("k")
i = D("i")
j = E("j")
d = F("d")
h = G("h")
l = H("l")
e = E("e")
c = B("c")

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: B = None
        self.s: A = None
        self.p: G = None
        self.u: B = None
        self.q: B = None
        self.z: B = None
        self.t: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: B = None
        self.p: D = None
        self.r: A = None
        self.t: A = None
        self.txt = txt

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

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

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

n = A("n")
g = B("g")
k = C("k")
i = D("i")
j = E("j")
d = F("d")
h = G("h")
l = H("l")
e = E("e")
c = B("c")

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