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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.s: A = None
        self.w: A = None
        self.o: E = None
        self.q: F = None
        self.txt = txt

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

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

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

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

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

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

e.p = n
e.w = c
m.s = e
m.w = e
m.o = f
m.q = a
c.u = m
c.y = m
c.p = b
c.o = e
c.v = f
c.s = a
j.x = f
j.s = c
j.u = e
j.y = e
j.p = b
j.q = h
j.w = m
f.w = n
f.r = e
a.z = e
a.x = f
a.r = f
a.q = h
a.p = n
n.p = h
n.x = c
n.r = j
n.s = a
n.o = a
h.x = f
h.s = b
h.u = e
h.y = e
h.p = c
h.q = j
h.w = m
b.u = m
b.y = m
b.p = c
b.o = e
b.v = f
b.s = a
assert h.s.s.z.p.p.u.w.txt == "c"