class A:
    def __init__(self, txt: str):
        self.w: G = None
        self.u: F = None
        self.q: H = None
        self.p: G = None
        self.x: F = None
        self.z: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.w: G = None
        self.x: D = None
        self.s: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.w: H = None
        self.u: G = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.x: D = None
        self.v: B = None
        self.y: A = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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

class B:
    def __init__(self, txt: str):
        self.x: H = None
        self.z: H = None
        self.w: A = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.t: B = None
        self.v: B = None
        self.w: G = None
        self.x: D = None
        self.s: A = None
        self.q: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.t: D = None
        self.s: F = None
        self.w: H = None
        self.u: G = None
        self.z: H = None
        self.txt = txt

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

class G:
    def __init__(self, txt: str):
        self.r: F = None
        self.w: A = None
        self.x: D = None
        self.v: B = None
        self.y: A = None
        self.z: A = None
        self.s: D = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.v: F = None
        self.u: C = None
        self.p: C = None
        self.txt = txt

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

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