class A:
    def __init__(self, txt: str):
        self.r: H = None
        self.v: F = None
        self.u: H = None
        self.w: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: D = None
        self.x: C = None
        self.y: D = None
        self.s: F = None
        self.o: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: H = None
        self.y: E = None
        self.w: E = None
        self.s: G = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: A = None
        self.u: F = None
        self.v: C = None
        self.z: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: D = None
        self.x: C = None
        self.y: D = None
        self.s: F = None
        self.o: D = None
        self.p: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.u: C = None
        self.o: H = None
        self.y: E = None
        self.w: E = None
        self.s: G = None
        self.q: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.w: F = None
        self.t: F = None
        self.txt = txt

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

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