class A:
    def __init__(self, txt: str):
        self.p: D = None
        self.y: F = None
        self.u: C = None
        self.x: C = None
        self.w: I = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: C = None
        self.o: H = None
        self.z: F = None
        self.q: C = None
        self.p: H = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.z: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.p: C = None
        self.u: H = None
        self.x: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: I = None
        self.w: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: G = None
        self.w: C = None
        self.o: H = None
        self.z: F = None
        self.q: C = None
        self.p: H = None
        self.x: C = None
        self.t: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.s: B = None
        self.o: D = None
        self.z: C = None
        self.v: D = None
        self.r: H = None
        self.txt = txt

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

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

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

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