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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.p: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.t: A = None
        self.u: E = None
        self.z: F = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.o: G = None
        self.v: E = None
        self.p: E = None
        self.txt = txt

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

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

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