class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.z: C = None
        self.o: E = None
        self.s: E = None
        self.x: D = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: D = None
        self.y: G = None
        self.v: F = None
        self.t: C = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: G = None
        self.o: E = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

b = A("b")
f = B("f")
n = C("n")
m = D("m")
i = E("i")
a = F("a")
c = G("c")
h = F("h")
d = E("d")

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

class B:
    def __init__(self, txt: str):
        self.s: C = None
        self.q: D = None
        self.y: G = None
        self.v: F = None
        self.t: C = None
        self.r: C = None
        self.z: D = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: B = None
        self.q: G = None
        self.o: E = None
        self.r: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.txt = txt

b = A("b")
f = B("f")
n = C("n")
m = D("m")
i = E("i")
a = F("a")
c = G("c")
h = F("h")
d = E("d")

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