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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.r: H = None
        self.z: A = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.s: E = None
        self.w: G = None
        self.r: H = None
        self.z: A = None
        self.x: H = None
        self.txt = txt

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

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

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

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

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

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

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