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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.o: H = None
        self.p: H = None
        self.x: B = None
        self.v: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.v: E = None
        self.y: H = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.u: C = None
        self.z: D = None
        self.x: G = None
        self.w: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.r: B = None
        self.t: E = None
        self.o: H = None
        self.p: H = None
        self.x: B = None
        self.v: H = None
        self.u: F = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.u: B = None
        self.s: C = None
        self.v: E = None
        self.y: H = None
        self.w: G = None
        self.q: G = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.s: G = None
        self.p: F = None
        self.q: F = None
        self.z: G = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.v: B = None
        self.o: B = None
        self.u: C = None
        self.z: D = None
        self.x: G = None
        self.w: C = None
        self.t: A = None
        self.txt = txt

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

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

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

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