class A:
    def __init__(self, txt: str):
        self.p: C = None
        self.q: C = None
        self.w: G = None
        self.r: A = None
        self.x: A = None
        self.s: A = None
        self.y: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: H = None
        self.o: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.p: H = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: B = None
        self.s: C = None
        self.y: D = None
        self.v: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: H = None
        self.t: H = None
        self.r: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.w: C = None
        self.z: C = None
        self.r: C = None
        self.v: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: F = None
        self.y: H = None
        self.o: G = None
        self.x: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.o: H = None
        self.r: B = None
        self.p: H = None
        self.q: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: B = None
        self.s: C = None
        self.y: D = None
        self.v: D = None
        self.x: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.s: D = None
        self.v: H = None
        self.t: H = None
        self.r: E = None
        self.z: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: A = None
        self.t: D = None
        self.w: C = None
        self.z: C = None
        self.r: C = None
        self.v: E = None
        self.y: E = None
        self.u: B = None
        self.txt = txt

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

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

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