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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: H = None
        self.z: D = None
        self.v: F = None
        self.y: F = None
        self.x: D = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.o: F = None
        self.q: F = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.z: A = None
        self.s: G = None
        self.w: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: G = None
        self.y: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.w: H = None
        self.z: D = None
        self.v: F = None
        self.y: F = None
        self.x: D = None
        self.r: H = None
        self.s: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.r: C = None
        self.p: C = None
        self.o: F = None
        self.q: F = None
        self.v: D = None
        self.y: A = None
        self.txt = txt

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

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