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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.w: E = None
        self.z: D = None
        self.u: C = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: H = None
        self.p: A = None
        self.t: E = None
        self.y: E = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.z: I = None
        self.o: G = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: D = None
        self.r: D = None
        self.w: E = None
        self.z: D = None
        self.u: C = None
        self.o: F = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: E = None
        self.x: H = None
        self.p: A = None
        self.t: E = None
        self.y: E = None
        self.u: A = None
        self.s: B = None
        self.txt = txt

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

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