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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.p: C = None
        self.w: F = None
        self.t: D = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: H = None
        self.u: B = None
        self.r: C = None
        self.t: G = None
        self.v: B = None
        self.s: G = None
        self.x: F = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.s: A = None
        self.p: C = None
        self.w: F = None
        self.t: D = None
        self.o: C = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.u: B = None
        self.r: G = None
        self.q: D = None
        self.t: E = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.z: G = None
        self.w: H = None
        self.u: B = None
        self.r: C = None
        self.t: G = None
        self.v: B = None
        self.s: G = None
        self.x: F = None
        self.txt = txt

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

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

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