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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: A = None
        self.t: B = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: I = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.txt = txt

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

f = A("f")
a = B("a")
b = C("b")
l = D("l")
n = E("n")
d = F("d")
j = G("j")
i = H("i")
m = I("m")

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

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

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

class D:
    def __init__(self, txt: str):
        self.v: H = None
        self.w: A = None
        self.t: B = None
        self.y: E = None
        self.s: B = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.q: H = None
        self.y: I = None
        self.z: A = None
        self.p: D = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.x: I = None
        self.txt = txt

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

f = A("f")
a = B("a")
b = C("b")
l = D("l")
n = E("n")
d = F("d")
j = G("j")
i = H("i")
m = I("m")

f.z = a
a.u = m
b.y = j
l.v = i
l.w = f
l.t = a
l.s = a
l.y = n
n.r = i
n.x = l
n.s = d
n.w = f
d.q = i
d.y = m
d.z = f
d.p = l
j.y = m
j.p = b
j.w = n
i.p = b
i.x = m
m.o = j
assert l.s.u.o.p.y.w.x.txt == "l"