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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.z: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: F = None
        self.x: G = None
        self.y: G = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.t: E = None
        self.p: F = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.p: E = None
        self.u: G = None
        self.z: A = None
        self.o: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.s: B = None
        self.w: F = None
        self.x: G = None
        self.y: G = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.x: F = None
        self.s: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.r: C = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.q: B = None
        self.r: F = None
        self.t: E = None
        self.p: F = None
        self.s: A = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.q: D = None
        self.s: C = None
        self.txt = txt

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

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