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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.o: C = None
        self.y: I = None
        self.s: F = None
        self.z: F = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: H = None
        self.y: H = None
        self.q: F = None
        self.o: F = None
        self.w: F = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.p: D = None
        self.z: G = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.r: E = None
        self.w: B = None
        self.t: C = None
        self.o: D = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.q: D = None
        self.r: C = None
        self.x: A = None
        self.o: C = None
        self.y: I = None
        self.s: F = None
        self.z: F = None
        self.v: C = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.v: E = None
        self.u: H = None
        self.y: H = None
        self.q: F = None
        self.o: F = None
        self.w: F = None
        self.r: H = None
        self.z: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.w: B = None
        self.o: A = None
        self.p: D = None
        self.z: G = None
        self.q: D = None
        self.r: C = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: E = None
        self.r: H = None
        self.s: E = None
        self.o: H = None
        self.txt = txt

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

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

class I:
    def __init__(self, txt: str):
        self.s: F = None
        self.z: D = None
        self.r: E = None
        self.w: B = None
        self.t: C = None
        self.o: D = None
        self.txt = txt

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

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