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

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.w: H = None
        self.r: A = None
        self.q: C = None
        self.p: I = None
        self.v: B = None
        self.txt = txt

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

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

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

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

g.y = i
g.o = m
g.r = c
g.t = a
c.p = m
c.y = g
c.q = a
e.q = c
e.w = n
e.v = n
i.r = m
m.q = g
m.z = a
n.y = e
n.q = e
n.x = m
n.w = b
n.r = g
n.p = d
n.v = c
a.y = n
b.v = g
b.z = m
b.u = e
d.z = b
d.r = f
d.v = f
d.x = i
d.t = i
d.p = c
d.q = a
d.o = m
f.r = m
assert b.u.v.v.q.y.r.r.txt == "
class A:
    def __init__(self, txt: str):
        self.y: D = None
        self.o: E = None
        self.r: B = None
        self.t: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.p: E = None
        self.y: A = None
        self.q: G = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: B = None
        self.w: F = None
        self.v: F = None
        self.txt = txt

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

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

class F:
    def __init__(self, txt: str):
        self.y: C = None
        self.x: E = None
        self.w: H = None
        self.r: A = None
        self.q: C = None
        self.p: I = None
        self.v: B = None
        self.txt = txt

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

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

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

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

g.y = i
g.o = m
g.r = c
g.t = a
c.p = m
c.y = g
c.q = a
e.q = c
e.w = n
e.v = n
i.r = m
m.q = g
m.z = a
n.y = e
n.q = e
n.x = m
n.w = b
n.r = g
n.p = d
n.v = c
a.y = n
b.v = g
b.z = m
b.u = e
d.z = b
d.r = f
d.v = f
d.x = i
d.t = i
d.p = c
d.q = a
d.o = m
f.r = m
assert b.u.v.v.q.y.r.r.txt == "c"