class A:
    def __init__(self, txt: str):
        self.p: F = None
        self.x: B = None
        self.z: E = None
        self.u: C = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.w: C = None
        self.y: G = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.z: F = None
        self.s: B = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.x: F = None
        self.u: C = None
        self.w: C = None
        self.y: G = None
        self.p: C = None
        self.txt = txt

class C:
    def __init__(self, txt: str):
        self.y: D = None
        self.v: E = None
        self.z: F = None
        self.s: B = None
        self.u: D = None
        self.r: H = None
        self.txt = txt

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

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

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

class G:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: E = None
        self.txt = txt

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

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

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