class A:
    def __init__(self, txt: str):
        self.r: D = None
        self.p: A = None
        self.s: H = None
        self.q: G = None
        self.txt = txt

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: E = None
        self.z: F = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.z: D = None
        self.x: H = None
        self.u: C = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

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

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

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

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

class D:
    def __init__(self, txt: str):
        self.y: E = None
        self.u: E = None
        self.z: F = None
        self.q: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: A = None
        self.q: F = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.o: C = None
        self.r: C = None
        self.z: D = None
        self.x: H = None
        self.u: C = None
        self.t: A = None
        self.w: B = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.u: D = None
        self.s: H = None
        self.txt = txt

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

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

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