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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.q: B = None
        self.s: F = None
        self.x: A = None
        self.y: A = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: C = None
        self.p: A = None
        self.q: I = None
        self.w: E = None
        self.s: A = None
        self.t: G = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.o: G = None
        self.u: H = None
        self.z: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: I = None
        self.t: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: C = None
        self.r: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.v: H = None
        self.o: A = None
        self.q: B = None
        self.s: F = None
        self.x: A = None
        self.y: A = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: G = None
        self.z: C = None
        self.p: A = None
        self.q: I = None
        self.w: E = None
        self.s: A = None
        self.t: G = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: B = None
        self.txt = txt

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

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