class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.s: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.u: H = None
        self.w: F = None
        self.t: F = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.w: D = None
        self.q: G = None
        self.u: H = None
        self.o: A = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.u: A = None
        self.r: C = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.v: B = None
        self.q: H = None
        self.u: H = None
        self.w: F = None
        self.t: F = None
        self.y: C = None
        self.o: I = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: C = None
        self.w: D = None
        self.q: G = None
        self.u: H = None
        self.o: A = None
        self.txt = txt

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

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