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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.s: C = None
        self.y: B = None
        self.u: B = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: D = None
        self.q: B = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: D = None
        self.q: B = None
        self.s: C = None
        self.y: B = None
        self.u: B = None
        self.o: D = None
        self.v: C = None
        self.txt = txt

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

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

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

j.x = l
j.z = d
j.t = d
j.u = d
j.s = g
j.y = m
j.r = h
m.r = i
m.u = l
m.z = n
l.o = g
l.q = m
g.q = n
g.z = i
n.r = g
n.o = g
n.q = m
n.y = m
n.u = m
n.s = l
n.v = l
i.u = n
i.o = d
h.v = d
h.s = i
h.o = i
h.y = j
h.q = l
d.x = l
d.z = j
d.t = j
d.u = j
d.s = g
d.y = m
d.r = h
assert i.o.r.s.u.y.z.s.o.txt == "g"