class A:
    def __init__(self, txt: str):
        self.u: F = None
        self.y: B = None
        self.r: I = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: F = None
        self.q: E = None
        self.x: C = None
        self.u: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.t: F = None
        self.q: E = None
        self.x: C = None
        self.u: E = None
        self.txt = txt

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

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

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

class H:
    def __init__(self, txt: str):
        self.r: A = None
        self.v: F = None
        self.p: G = None
        self.txt = txt

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

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

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