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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.s: B = None
        self.z: D = None
        self.r: B = None
        self.q: H = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

a = A("a")
c = B("c")
k = C("k")
e = D("e")
g = E("g")
h = F("h")
d = G("d")
j = H("j")
b = H("b")
m = C("m")

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

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

class C:
    def __init__(self, txt: str):
        self.o: E = None
        self.x: B = None
        self.s: B = None
        self.z: D = None
        self.r: B = None
        self.q: H = None
        self.w: G = None
        self.txt = txt

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

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

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

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

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

a = A("a")
c = B("c")
k = C("k")
e = D("e")
g = E("g")
h = F("h")
d = G("d")
j = H("j")
b = H("b")
m = C("m")

a.r = h
c.z = e
k.o = g
k.x = c
k.s = c
k.r = c
k.z = e
k.q = b
k.w = d
e.v = c
g.v = c
g.z = h
h.z = e
h.s = a
h.y = a
h.v = g
h.u = c
h.p = c
d.q = h
d.u = h
d.p = h
d.w = j
d.t = j
d.v = m
d.o = g
j.y = h
j.v = b
j.t = e
j.x = g
j.w = d
b.y = h
b.v = j
b.t = e
b.x = g
b.w = d
m.o = g
m.x = c
m.s = c
m.r = c
m.z = e
m.q = b
m.w = d
assert d.v.q.v.y.v.z.z.v.z.v.txt == "c"