class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.q: F = None
        self.y: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

e.t = i
e.o = g
e.y = g
e.q = h
e.x = h
a.s = m
a.x = h
g.t = e
g.o = h
g.s = m
g.v = n
i.x = h
i.y = e
i.u = m
i.s = n
i.t = g
m.t = n
m.y = g
m.x = a
h.r = i
h.w = e
h.z = g
h.x = g
h.s = n
h.u = n
h.t = m
n.y = a
n.o = h
n.u = h
assert a.x.r.x.r.s.u.t.txt == "
class A:
    def __init__(self, txt: str):
        self.t: D = None
        self.o: C = None
        self.q: F = None
        self.y: C = None
        self.x: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: E = None
        self.x: F = None
        self.txt = txt

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

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

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

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

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

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

e.t = i
e.o = g
e.y = g
e.q = h
e.x = h
a.s = m
a.x = h
g.t = e
g.o = h
g.s = m
g.v = n
i.x = h
i.y = e
i.u = m
i.s = n
i.t = g
m.t = n
m.y = g
m.x = a
h.r = i
h.w = e
h.z = g
h.x = g
h.s = n
h.u = n
h.t = m
n.y = a
n.o = h
n.u = h
assert a.x.r.x.r.s.u.t.txt == "m"