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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = None
        self.t: G = None
        self.q: E = None
        self.u: G = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: H = None
        self.u: H = None
        self.q: B = None
        self.txt = txt

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

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

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

class B:
    def __init__(self, txt: str):
        self.z: C = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.r: A = None
        self.w: B = None
        self.t: G = None
        self.q: E = None
        self.u: G = None
        self.y: H = None
        self.p: B = None
        self.txt = txt

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

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

class G:
    def __init__(self, txt: str):
        self.w: D = None
        self.r: H = None
        self.u: H = None
        self.q: B = None
        self.txt = txt

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

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

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