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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: G = None
        self.r: A = None
        self.p: I = None
        self.v: G = None
        self.u: I = None
        self.w: E = None
        self.q: A = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: G = None
        self.q: C = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.v: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: I = None
        self.v: A = None
        self.w: C = None
        self.p: B = None
        self.z: C = None
        self.x: A = None
        self.o: B = None
        self.t: C = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.z: I = None
        self.x: G = None
        self.r: A = None
        self.p: I = None
        self.v: G = None
        self.u: I = None
        self.w: E = None
        self.q: A = None
        self.y: H = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.x: I = None
        self.r: G = None
        self.q: C = None
        self.z: B = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.x: E = None
        self.v: C = None
        self.o: D = None
        self.u: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.s: D = None
        self.y: I = None
        self.v: A = None
        self.w: C = None
        self.p: B = None
        self.z: C = None
        self.x: A = None
        self.o: B = None
        self.t: C = None
        self.txt = txt

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

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

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