class A:
    def __init__(self, txt: str):
        self.s: B = None
        self.v: H = None
        self.txt = txt

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: G = None
        self.v: H = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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

class B:
    def __init__(self, txt: str):
        self.r: D = None
        self.o: H = None
        self.y: C = None
        self.u: D = None
        self.txt = txt

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

class D:
    def __init__(self, txt: str):
        self.p: B = None
        self.t: G = None
        self.v: H = None
        self.r: A = None
        self.txt = txt

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

class F:
    def __init__(self, txt: str):
        self.w: H = None
        self.u: C = None
        self.q: A = None
        self.z: A = None
        self.txt = txt

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

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

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

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