class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.u: F = None
        self.y: G = None
        self.t: C = None
        self.o: I = None
        self.x: F = None
        self.w: F = None
        self.s: G = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = 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.t: F = None
        self.txt = txt

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.v: F = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.r: B = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: H = 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.t: F = None
        self.txt = txt

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

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

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