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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

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

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

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

class C:
    def __init__(self, txt: str):
        self.w: E = None
        self.t: G = None
        self.q: G = None
        self.txt = txt

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

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

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

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

class H:
    def __init__(self, txt: str):
        self.p: C = None
        self.y: C = None
        self.v: G = None
        self.t: E = None
        self.txt = txt

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

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