class A:
    def __init__(self, txt: str):
        self.y: F = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.v: E = None
        self.s: G = None
        self.r: G = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: F = None
        self.t: B = None
        self.y: C = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.t: C = None
        self.u: C = None
        self.v: E = None
        self.s: G = None
        self.r: G = None
        self.x: B = None
        self.z: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.q: E = None
        self.v: F = None
        self.t: B = None
        self.y: C = None
        self.u: E = None
        self.r: E = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.q: A = None
        self.u: F = None
        self.r: G = None
        self.z: A = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.w: F = None
        self.txt = txt

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

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