class A:
    def __init__(self, txt: str):
        self.z: F = None
        self.x: F = None
        self.t: H = None
        self.y: E = None
        self.w: E = None
        self.q: G = None
        self.p: E = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: E = None
        self.s: A = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.t: C = None
        self.y: F = None
        self.o: I = None
        self.x: G = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.y: B = None
        self.v: H = None
        self.w: B = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.u: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: C = None
        self.p: E = None
        self.s: A = None
        self.t: F = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.r: C = None
        self.z: C = None
        self.t: C = None
        self.y: F = None
        self.o: I = None
        self.x: G = None
        self.v: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: A = None
        self.y: B = None
        self.v: H = None
        self.w: B = None
        self.x: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.u: A = None
        self.x: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.w: E = None
        self.r: C = None
        self.u: G = None
        self.z: A = None
        self.y: F = None
        self.txt = txt

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

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