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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.t: H = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: H = None
        self.r: B = None
        self.y: H = None
        self.x: B = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.x: E = None
        self.y: E = None
        self.t: H = None
        self.r: E = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: I = None
        self.p: H = None
        self.r: B = None
        self.y: H = None
        self.x: B = None
        self.s: H = None
        self.txt = txt

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

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

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

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