class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: B = None
        self.r: C = None
        self.z: B = None
        self.q: B = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.x: D = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.r: G = None
        self.q: D = None
        self.s: D = None
        self.p: C = None
        self.z: B = None
        self.txt = txt

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

g = A("g")
h = B("h")
m = C("m")
j = D("j")
e = E("e")
l = F("l")
c = G("c")
d = D("d")
n = A("n")
b = F("b")

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

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

class C:
    def __init__(self, txt: str):
        self.u: A = None
        self.o: A = None
        self.y: E = None
        self.s: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.x: B = None
        self.r: C = None
        self.z: B = None
        self.q: B = None
        self.w: C = None
        self.v: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.s: G = None
        self.x: D = None
        self.p: D = None
        self.u: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: D = None
        self.w: G = None
        self.r: G = None
        self.q: D = None
        self.s: D = None
        self.p: C = None
        self.z: B = None
        self.txt = txt

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

g = A("g")
h = B("h")
m = C("m")
j = D("j")
e = E("e")
l = F("l")
c = G("c")
d = D("d")
n = A("n")
b = F("b")

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