class A:
    def __init__(self, txt: str):
        self.o: C = None
        self.u: D = None
        self.r: E = None
        self.x: H = None
        self.y: B = None
        self.v: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: D = None
        self.x: E = None
        self.u: E = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.r: H = None
        self.v: B = None
        self.z: E = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.s: B = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: H = None
        self.v: H = None
        self.q: F = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: B = None
        self.o: A = None
        self.txt = txt

a = A("a")
d = B("d")
h = C("h")
c = D("c")
b = E("b")
m = F("m")
l = G("l")
k = H("k")
n = C("n")
i = E("i")

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

class B:
    def __init__(self, txt: str):
        self.v: D = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.z: B = None
        self.v: D = None
        self.x: E = None
        self.u: E = None
        self.q: A = None
        self.y: E = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.y: G = None
        self.s: B = None
        self.r: H = None
        self.v: B = None
        self.z: E = None
        self.t: C = None
        self.p: F = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.y: E = None
        self.p: D = None
        self.s: B = None
        self.q: C = None
        self.v: B = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.o: F = None
        self.y: H = None
        self.v: H = None
        self.q: F = None
        self.w: D = None
        self.r: A = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: G = None
        self.s: B = None
        self.o: A = None
        self.txt = txt

a = A("a")
d = B("d")
h = C("h")
c = D("c")
b = E("b")
m = F("m")
l = G("l")
k = H("k")
n = C("n")
i = E("i")

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