class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: E = None
        self.y: B = None
        self.p: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.w: H = None
        self.p: H = None
        self.s: B = None
        self.y: G = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.z: G = None
        self.t: H = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.w: B = None
        self.r: A = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.t: H = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: F = None
        self.v: F = None
        self.w: H = None
        self.p: H = None
        self.s: B = None
        self.y: G = None
        self.o: D = None
        self.x: F = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.o: E = None
        self.u: C = None
        self.z: G = None
        self.t: H = None
        self.w: A = None
        self.p: E = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.t: B = None
        self.s: B = None
        self.w: B = None
        self.r: A = None
        self.y: H = None
        self.p: F = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.p: C = None
        self.t: H = None
        self.txt = txt

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

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

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