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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: H = None
        self.t: C = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: I = None
        self.r: H = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: A = None
        self.q: G = None
        self.o: G = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.s: I = None
        self.o: H = None
        self.t: C = None
        self.v: G = None
        self.q: I = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.x: F = None
        self.q: I = None
        self.r: H = None
        self.txt = txt

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

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

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

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