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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: H = None
        self.y: H = None
        self.x: D = None
        self.z: H = None
        self.q: E = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.w: A = None
        self.u: F = None
        self.s: H = None
        self.o: H = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.u: A = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.r: H = None
        self.y: B = None
        self.x: H = None
        self.p: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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

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

class C:
    def __init__(self, txt: str):
        self.s: G = None
        self.u: H = None
        self.y: H = None
        self.x: D = None
        self.z: H = None
        self.q: E = None
        self.o: G = None
        self.v: A = None
        self.txt = txt

class D:
    def __init__(self, txt: str):
        self.x: B = None
        self.p: F = None
        self.w: A = None
        self.u: F = None
        self.s: H = None
        self.o: H = None
        self.t: A = None
        self.txt = txt

class E:
    def __init__(self, txt: str):
        self.p: H = None
        self.o: H = None
        self.u: A = None
        self.x: G = None
        self.z: H = None
        self.txt = txt

class F:
    def __init__(self, txt: str):
        self.q: A = None
        self.w: G = None
        self.r: H = None
        self.y: B = None
        self.x: H = None
        self.p: H = None
        self.o: B = None
        self.txt = txt

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

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

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

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