class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: F = None
        self.t: G = None
        self.z: D = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.v: D = None
        self.p: D = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: F = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

k = A("k")
n = B("n")
d = C("d")
g = D("g")
a = E("a")
f = F("f")
l = G("l")
h = H("h")

k.w = a
k.y = l
n.w = a
n.v = a
n.x = f
n.q = f
n.t = l
n.z = g
d.y = f
g.p = h
g.u = h
g.z = d
g.y = f
a.y = k
a.s = k
a.u = n
a.z = f
f.z = g
f.w = g
f.v = g
f.p = g
f.u = a
l.w = k
l.q = k
l.o = f
l.y = g
h.r = g
assert a.u.v.u.q.u.y.w.txt == "
class A:
    def __init__(self, txt: str):
        self.w: E = None
        self.y: G = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.w: E = None
        self.x: F = None
        self.t: G = None
        self.z: D = None
        self.q: F = None
        self.v: E = None
        self.txt = txt

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

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

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

class F:
    def __init__(self, txt: str):
        self.z: D = None
        self.w: D = None
        self.v: D = None
        self.p: D = None
        self.u: E = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: A = None
        self.o: F = None
        self.q: A = None
        self.y: D = None
        self.txt = txt

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

k = A("k")
n = B("n")
d = C("d")
g = D("g")
a = E("a")
f = F("f")
l = G("l")
h = H("h")

k.w = a
k.y = l
n.w = a
n.v = a
n.x = f
n.q = f
n.t = l
n.z = g
d.y = f
g.p = h
g.u = h
g.z = d
g.y = f
a.y = k
a.s = k
a.u = n
a.z = f
f.z = g
f.w = g
f.v = g
f.p = g
f.u = a
l.w = k
l.q = k
l.o = f
l.y = g
h.r = g
assert a.u.v.u.q.u.y.w.txt == "a"