class A:
    def __init__(self, txt: str):
        self.r: C = None
        self.o: E = None
        self.u: E = None
        self.p: F = None
        self.s: G = None
        self.v: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.p: D = None
        self.r: H = None
        self.s: E = None
        self.q: I = None
        self.t: H = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.o: I = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.t: E = None
        self.r: H = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.v: E = None
        self.x: E = None
        self.p: D = None
        self.r: H = None
        self.s: E = None
        self.q: I = None
        self.t: H = None
        self.w: E = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.x: A = None
        self.p: D = None
        self.o: I = None
        self.v: E = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class I:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: C = None
        self.t: E = None
        self.r: H = None
        self.z: A = None
        self.s: H = None
        self.txt = txt

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

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