class A:
    def __init__(self, txt: str):
        self.x: D = None
        self.txt = txt

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: B = None
        self.t: C = None
        self.s: C = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.w: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: G = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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

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

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

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

class E:
    def __init__(self, txt: str):
        self.w: A = None
        self.r: B = None
        self.t: C = None
        self.s: C = None
        self.u: B = None
        self.q: A = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.x: G = None
        self.u: D = None
        self.w: H = None
        self.q: B = None
        self.r: E = None
        self.txt = txt

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

class H:
    def __init__(self, txt: str):
        self.x: D = None
        self.t: G = None
        self.r: G = None
        self.y: G = None
        self.txt = txt

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

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