class A:
    def __init__(self, txt: str):
        self.v: G = None
        self.x: B = None
        self.q: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: D = None
        self.w: A = None
        self.r: D = None
        self.y: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.x: A = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.v: H = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

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

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.u: G = None
        self.v: D = None
        self.w: A = None
        self.r: D = None
        self.y: F = None
        self.x: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: B = None
        self.x: A = None
        self.q: B = None
        self.p: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: F = None
        self.t: D = None
        self.v: H = None
        self.r: F = None
        self.q: E = None
        self.txt = txt

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

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

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