class A:
    def __init__(self, txt: str):
        self.t: H = None
        self.x: D = None
        self.o: I = None
        self.v: F = None
        self.y: E = None
        self.z: H = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: I = None
        self.z: D = None
        self.x: A = None
        self.p: E = None
        self.o: F = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: F = None
        self.r: B = None
        self.v: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: G = None
        self.y: I = None
        self.z: D = None
        self.x: A = None
        self.p: E = None
        self.o: F = None
        self.u: E = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.v: A = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.z: G = None
        self.v: G = None
        self.r: G = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: G = None
        self.s: F = None
        self.r: B = None
        self.v: G = None
        self.txt = txt

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

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