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

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.x: C = None
        self.s: F = None
        self.p: F = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: A = None
        self.s: F = None
        self.txt = txt

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

b.u = a
b.s = a
b.z = d
b.x = f
j.o = c
j.z = c
j.x = a
j.s = m
j.p = m
j.y = f
j.q = b
a.o = c
a.t = g
a.u = e
a.s = h
c.z = a
f.o = a
f.z = c
f.t = j
f.p = d
f.w = g
d.t = j
d.z = f
g.u = d
g.s = d
g.t = h
h.u = a
h.s = a
h.z = d
h.x = f
m.t = e
m.z = f
e.o = c
e.z = c
e.x = a
e.s = d
e.p = m
e.y = f
e.q = h
assert g.t.z.t.s.z.z.z.txt == "
class A:
    def __init__(self, txt: str):
        self.u: C = None
        self.z: F = None
        self.s: C = None
        self.x: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: D = None
        self.z: D = None
        self.x: C = None
        self.s: F = None
        self.p: F = None
        self.y: E = None
        self.q: A = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: A = None
        self.s: F = None
        self.txt = txt

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

b.u = a
b.s = a
b.z = d
b.x = f
j.o = c
j.z = c
j.x = a
j.s = m
j.p = m
j.y = f
j.q = b
a.o = c
a.t = g
a.u = e
a.s = h
c.z = a
f.o = a
f.z = c
f.t = j
f.p = d
f.w = g
d.t = j
d.z = f
g.u = d
g.s = d
g.t = h
h.u = a
h.s = a
h.z = d
h.x = f
m.t = e
m.z = f
e.o = c
e.z = c
e.x = a
e.s = d
e.p = m
e.y = f
e.q = h
assert g.t.z.t.s.z.z.z.txt == "a"