class A:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: F = None
        self.p: B = None
        self.s: D = None
        self.y: D = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: F = None
        self.s: D = None
        self.r: F = None
        self.p: C = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.x: H = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.o: B = None
        self.z: C = None
        self.r: B = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.o: H = None
        self.x: A = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: C = None
        self.w: F = None
        self.s: D = None
        self.r: F = None
        self.p: C = None
        self.v: D = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: E = None
        self.u: H = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.s: E = None
        self.x: H = None
        self.t: B = None
        self.q: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: F = None
        self.t: E = None
        self.o: B = None
        self.z: C = None
        self.r: B = None
        self.txt = txt

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

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