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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.p: B = None
        self.z: F = None
        self.u: F = None
        self.w: A = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: H = None
        self.p: A = None
        self.z: G = None
        self.y: I = None
        self.r: I = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
a = C("a")
f = D("f")
c = E("c")
h = F("h")
e = G("e")
l = H("l")
d = I("d")

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.r: H = None
        self.p: B = None
        self.z: F = None
        self.u: F = None
        self.w: A = None
        self.x: F = None
        self.v: H = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.u: I = None
        self.v: H = None
        self.p: A = None
        self.z: G = None
        self.y: I = None
        self.r: I = None
        self.o: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.s: H = None
        self.p: H = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: C = None
        self.o: C = None
        self.txt = txt

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

g = A("g")
n = B("n")
a = C("a")
f = D("f")
c = E("c")
h = F("h")
e = G("e")
l = H("l")
d = I("d")

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