class A:
    def __init__(self, txt: str):
        self.q: F = None
        self.o: G = None
        self.r: D = None
        self.v: B = None
        self.t: D = None
        self.w: E = None
        self.p: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.r: G = None
        self.y: D = None
        self.u: C = None
        self.o: E = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.q: H = None
        self.t: A = None
        self.x: G = None
        self.p: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.t: D = None
        self.q: A = None
        self.r: G = None
        self.y: D = None
        self.u: C = None
        self.o: E = None
        self.x: D = None
        self.p: A = None
        self.txt = txt

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

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

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

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