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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.o: E = None
        self.z: H = None
        self.x: A = None
        self.t: I = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.r: E = None
        self.o: E = None
        self.z: H = None
        self.x: A = None
        self.t: I = None
        self.txt = txt

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

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

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

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

class G:
    def __init__(self, txt: str):
        self.s: C = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: I = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: F = None
        self.x: B = None
        self.p: A = None
        self.w: F = None
        self.txt = txt

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

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