class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: H = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: F = None
        self.r: A = None
        self.v: G = None
        self.x: F = None
        self.u: C = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.o: B = None
        self.x: A = None
        self.q: E = None
        self.u: F = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

i = A("i")
m = B("m")
e = C("e")
d = D("d")
n = E("n")
c = F("c")
g = G("g")
b = H("b")
a = I("a")

i.v = c
i.z = m
m.y = c
m.o = a
m.t = a
m.w = b
m.z = b
m.u = d
m.p = d
m.r = d
m.q = n
e.o = b
d.y = e
n.x = b
n.t = d
n.u = g
c.u = i
c.t = i
c.z = b
c.q = e
g.z = a
g.p = i
g.w = c
g.u = n
g.x = e
b.t = n
b.y = c
b.x = c
b.r = i
b.v = g
b.u = e
b.p = a
b.w = m
a.z = c
a.u = c
a.t = i
a.x = i
a.o = m
a.w = m
a.q = n
a.y = e
assert a.y.o.w.u.txt == "
class A:
    def __init__(self, txt: str):
        self.v: F = None
        self.z: B = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: C = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.u: A = None
        self.z: H = None
        self.t: A = None
        self.q: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.t: E = None
        self.y: F = None
        self.r: A = None
        self.v: G = None
        self.x: F = None
        self.u: C = None
        self.p: I = None
        self.w: B = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: F = None
        self.t: A = None
        self.o: B = None
        self.x: A = None
        self.q: E = None
        self.u: F = None
        self.w: B = None
        self.y: C = None
        self.txt = txt

i = A("i")
m = B("m")
e = C("e")
d = D("d")
n = E("n")
c = F("c")
g = G("g")
b = H("b")
a = I("a")

i.v = c
i.z = m
m.y = c
m.o = a
m.t = a
m.w = b
m.z = b
m.u = d
m.p = d
m.r = d
m.q = n
e.o = b
d.y = e
n.x = b
n.t = d
n.u = g
c.u = i
c.t = i
c.z = b
c.q = e
g.z = a
g.p = i
g.w = c
g.u = n
g.x = e
b.t = n
b.y = c
b.x = c
b.r = i
b.v = g
b.u = e
b.p = a
b.w = m
a.z = c
a.u = c
a.t = i
a.x = i
a.o = m
a.w = m
a.q = n
a.y = e
assert a.y.o.w.u.txt == "d"