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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: H = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.x: G = None
        self.s: F = None
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.y: A = None
        self.u: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: G = None
        self.w: D = None
        self.x: A = None
        self.t: D = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.z: H = None
        self.q: F = None
        self.p: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.y: F = None
        self.x: G = None
        self.s: F = None
        self.r: E = None
        self.u: A = None
        self.txt = txt

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

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

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

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