class A:
    def __init__(self, txt: str):
        self.w: B = None
        self.v: H = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: E = None
        self.p: A = None
        self.x: E = None
        self.v: E = None
        self.z: E = None
        self.r: B = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.r: G = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.y: D = None
        self.u: F = None
        self.o: H = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.s: F = None
        self.y: E = None
        self.p: A = None
        self.x: E = None
        self.v: E = None
        self.z: E = None
        self.r: B = None
        self.u: B = None
        self.t: E = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.y: E = None
        self.z: C = None
        self.r: G = None
        self.q: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.o: B = None
        self.u: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: C = None
        self.y: D = None
        self.u: F = None
        self.o: H = None
        self.z: C = None
        self.txt = txt

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

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