class A:
    def __init__(self, txt: str):
        self.r: E = None
        self.q: F = None
        self.z: H = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.u: G = None
        self.z: C = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.p: F = None
        self.w: B = None
        self.z: C = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.v: C = None
        self.y: H = None
        self.z: G = None
        self.txt = txt

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

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

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

class I:
    def __init__(self, txt: str):
        self.p: H = None
        self.x: A = None
        self.u: G = None
        self.z: C = None
        self.y: D = None
        self.s: B = None
        self.txt = txt

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

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