class A:
    def __init__(self, txt: str):
        self.p: E = None
        self.q: E = None
        self.u: I = None
        self.r: D = None
        self.w: H = None
        self.x: I = None
        self.y: C = None
        self.z: B = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: F = None
        self.t: F = None
        self.q: B = None
        self.z: F = None
        self.r: C = None
        self.w: G = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: I = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.o: F = None
        self.x: F = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: G = None
        self.w: H = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: I = None
        self.p: F = None
        self.t: F = None
        self.q: B = None
        self.z: F = None
        self.r: C = None
        self.w: G = None
        self.v: I = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.v: E = None
        self.z: I = None
        self.txt = txt

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

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

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