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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: H = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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