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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.w: D = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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

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

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

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.q: G = None
        self.o: A = None
        self.x: D = None
        self.z: I = None
        self.txt = txt

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

class J:
    def __init__(self, txt: str):
        self.u: D = None
        self.p: D = None
        self.w: D = None
        self.s: C = None
        self.o: F = None
        self.txt = txt

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

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