class A:
    def __init__(self, txt: str):
        self.w: I = None
        self.o: F = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.z: H = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.u: D = None
        self.txt = txt

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

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

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