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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.s: B = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: C = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
i = D("i")
b = E("b")
l = F("l")
k = G("k")
m = H("m")
h = G("h")
g = F("g")

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

class B:
    def __init__(self, txt: str):
        self.y: D = None
        self.q: H = None
        self.p: A = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.o: A = None
        self.p: G = None
        self.s: B = None
        self.u: C = None
        self.t: G = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: A = None
        self.p: C = None
        self.r: B = None
        self.z: D = None
        self.txt = txt

n = A("n")
a = B("a")
j = C("j")
i = D("i")
b = E("b")
l = F("l")
k = G("k")
m = H("m")
h = G("h")
g = F("g")

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