class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.p: E = None
        self.w: D = None
        self.q: D = None
        self.u: G = None
        self.s: G = None
        self.z: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: C = None
        self.o: G = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.w: D = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.y: F = None
        self.o: G = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.r: E = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.o: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.s: H = None
        self.q: C = None
        self.o: G = None
        self.r: C = None
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.y: A = None
        self.v: A = None
        self.w: D = None
        self.r: H = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.w: G = None
        self.y: F = None
        self.o: G = None
        self.u: D = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.t: A = None
        self.o: D = None
        self.r: E = None
        self.x: A = None
        self.p: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.q: F = None
        self.u: D = None
        self.o: F = None
        self.t: C = None
        self.v: F = None
        self.txt = txt

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

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