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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: B = None
        self.x: H = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: I = None
        self.u: F = None
        self.x: I = None
        self.r: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: F = None
        self.q: B = None
        self.x: H = None
        self.u: B = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.p: C = None
        self.t: I = None
        self.u: F = None
        self.x: I = None
        self.r: H = None
        self.w: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: B = None
        self.w: D = None
        self.t: B = None
        self.txt = txt

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

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

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

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

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