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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.y: B = None
        self.u: G = None
        self.w: E = None
        self.x: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: G = None
        self.z: C = None
        self.txt = txt

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

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

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

m.o = l
m.s = e
m.p = g
m.z = g
m.q = a
a.r = h
a.z = h
b.y = a
b.u = g
b.x = g
b.w = l
n.u = h
n.o = g
n.y = l
n.z = b
n.q = a
l.q = g
l.z = b
h.q = e
h.x = e
g.q = m
g.s = l
g.o = h
e.o = l
e.s = m
e.p = g
e.z = g
e.q = a
assert g.q.p.s.q.s.txt == "l"