class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.v: B = None
        self.u: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: E = None
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: B = None
        self.q: H = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

d.p = b
d.r = g
d.v = c
d.u = i
c.v = d
c.s = g
b.p = k
b.w = k
b.y = n
b.r = a
a.o = b
a.u = d
a.q = c
n.q = i
n.o = b
n.y = k
n.r = k
n.t = g
n.p = g
g.p = k
g.w = b
f.v = n
f.o = n
f.q = n
f.p = k
f.s = g
k.z = c
k.s = c
k.q = a
k.v = a
k.p = n
k.o = n
k.u = d
k.y = f
i.w = d
i.p = c
i.q = k
i.s = g
i.y = g
h.v = n
h.o = n
h.q = n
h.p = k
h.s = g
assert b.w.y.v.o.y.q.txt == "
class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.r: F = None
        self.v: B = None
        self.u: I = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: H = None
        self.y: E = None
        self.w: H = None
        self.r: D = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: B = None
        self.q: H = None
        self.s: F = None
        self.y: F = None
        self.txt = txt

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

d.p = b
d.r = g
d.v = c
d.u = i
c.v = d
c.s = g
b.p = k
b.w = k
b.y = n
b.r = a
a.o = b
a.u = d
a.q = c
n.q = i
n.o = b
n.y = k
n.r = k
n.t = g
n.p = g
g.p = k
g.w = b
f.v = n
f.o = n
f.q = n
f.p = k
f.s = g
k.z = c
k.s = c
k.q = a
k.v = a
k.p = n
k.o = n
k.u = d
k.y = f
i.w = d
i.p = c
i.q = k
i.s = g
i.y = g
h.v = n
h.o = n
h.q = n
h.p = k
h.s = g
assert b.w.y.v.o.y.q.txt == "i"