class A:
    def __init__(self, txt: str):
        self.r: I = None
        self.w: C = None
        self.t: F = None
        self.y: B = None
        self.o: G = None
        self.z: B = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: E = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: D = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.o: A = None
        self.q: A = None
        self.r: E = None
        self.x: G = None
        self.w: D = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.r: H = None
        self.x: D = None
        self.s: I = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.u: C = None
        self.x: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: D = None
        self.x: A = None
        self.z: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.o: E = None
        self.txt = txt

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

class I:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

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