class A:
    def __init__(self, txt: str):
        self.p: H = None
        self.r: G = None
        self.txt = txt

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.r: B = None
        self.u: H = None
        self.x: H = None
        self.t: I = None
        self.q: E = None
        self.o: I = None
        self.p: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.y: D = None
        self.w: H = None
        self.r: B = None
        self.u: H = None
        self.x: H = None
        self.t: I = None
        self.q: E = None
        self.o: I = None
        self.p: F = None
        self.txt = txt

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

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

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

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