class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.x: D = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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