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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: G = None
        self.u: A = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.r: G = None
        self.u: A = None
        self.s: G = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.w: A = None
        self.txt = txt

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

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

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