class A:
    def __init__(self, txt: str):
        self.z: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: D = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.s: G = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.p: E = None
        self.y: A = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: H = None
        self.v: D = None
        self.u: E = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.y: G = None
        self.p: D = None
        self.z: A = None
        self.q: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: A = None
        self.t: G = None
        self.s: G = None
        self.p: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: F = None
        self.o: H = None
        self.r: F = None
        self.v: F = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.q: F = None
        self.p: E = None
        self.y: A = None
        self.r: C = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: H = None
        self.v: D = None
        self.u: E = None
        self.o: E = None
        self.q: D = None
        self.txt = txt

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

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