class A:
    def __init__(self, txt: str):
        self.r: F = None
        self.y: B = None
        self.s: F = None
        self.p: G = None
        self.v: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: G = None
        self.p: C = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.v: I = None
        self.q: F = None
        self.x: B = None
        self.u: B = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: A = None
        self.p: F = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: E = None
        self.o: H = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.w: H = None
        self.y: G = None
        self.p: C = None
        self.z: C = None
        self.s: C = None
        self.txt = txt

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

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

class E:
    def __init__(self, txt: str):
        self.p: A = None
        self.z: B = None
        self.q: B = None
        self.t: G = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.p: E = None
        self.o: B = None
        self.v: I = None
        self.q: F = None
        self.x: B = None
        self.u: B = None
        self.t: E = None
        self.y: B = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.y: F = None
        self.t: A = None
        self.p: F = None
        self.x: D = None
        self.txt = txt

class I:
    def __init__(self, txt: str):
        self.z: H = None
        self.x: E = None
        self.o: H = None
        self.w: C = None
        self.p: G = None
        self.txt = txt

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

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