class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.o: C = None
        self.r: D = None
        self.w: C = None
        self.z: I = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.x: E = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

d = A("d")
g = B("g")
f = C("f")
n = D("n")
e = E("e")
k = F("k")
m = G("m")
h = H("h")
j = I("j")

d.p = n
d.u = e
g.u = m
g.y = m
g.x = k
g.s = h
g.o = f
f.t = g
n.q = h
e.u = k
k.s = d
k.y = n
k.r = n
k.o = f
k.w = f
k.q = f
k.z = j
m.u = e
m.x = e
m.o = n
m.p = d
m.q = j
h.o = g
h.z = g
j.r = h
j.z = f
j.w = d
assert n.q.o.o.t.x.z.txt == "
class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.u: E = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.q: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.s: A = None
        self.y: D = None
        self.o: C = None
        self.r: D = None
        self.w: C = None
        self.z: I = None
        self.q: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: E = None
        self.o: D = None
        self.x: E = None
        self.p: A = None
        self.q: I = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.z: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.z: C = None
        self.w: A = None
        self.txt = txt

d = A("d")
g = B("g")
f = C("f")
n = D("n")
e = E("e")
k = F("k")
m = G("m")
h = H("h")
j = I("j")

d.p = n
d.u = e
g.u = m
g.y = m
g.x = k
g.s = h
g.o = f
f.t = g
n.q = h
e.u = k
k.s = d
k.y = n
k.r = n
k.o = f
k.w = f
k.q = f
k.z = j
m.u = e
m.x = e
m.o = n
m.p = d
m.q = j
h.o = g
h.z = g
j.r = h
j.z = f
j.w = d
assert n.q.o.o.t.x.z.txt == "j"