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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.r: B = None
        self.t: I = None
        self.o: D = None
        self.q: I = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.y: I = None
        self.o: F = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: H = None
        self.y: B = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.z: D = None
        self.x: I = None
        self.r: B = None
        self.t: I = None
        self.o: D = None
        self.q: I = None
        self.u: H = None
        self.p: F = None
        self.txt = txt

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

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

class H:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: C = None
        self.y: I = None
        self.o: F = None
        self.r: E = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: H = None
        self.y: B = None
        self.txt = txt

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

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