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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: C = None
        self.w: D = None
        self.txt = txt

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

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

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

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

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

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