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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.y: D = None
        self.r: H = None
        self.w: G = None
        self.p: A = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: B = None
        self.o: G = None
        self.q: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.q: C = None
        self.z: A = None
        self.y: D = None
        self.r: H = None
        self.w: G = None
        self.p: A = None
        self.v: F = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.z: C = None
        self.s: E = None
        self.w: C = None
        self.txt = txt

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

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