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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: H = None
        self.t: D = None
        self.p: A = None
        self.o: E = None
        self.s: H = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: H = None
        self.u: A = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: B = None
        self.z: H = None
        self.t: D = None
        self.p: A = None
        self.o: E = None
        self.s: H = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: E = None
        self.v: H = None
        self.u: A = None
        self.x: D = None
        self.r: G = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.q: D = None
        self.txt = txt

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

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