class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

f.x = g
f.u = d
f.q = b
f.v = c
d.v = m
d.o = m
d.w = m
d.y = i
d.s = f
c.u = a
b.y = d
b.s = c
b.r = c
b.q = m
b.o = m
b.x = g
b.t = g
b.u = a
g.v = a
g.r = c
g.w = f
g.s = d
i.z = g
a.r = m
a.v = b
a.z = b
a.p = b
m.v = i
m.u = i
m.r = g
m.z = g
m.p = g
m.s = g
m.y = b
assert d.s.v.u.txt == "
class A:
    def __init__(self, txt: str):
        self.x: E = None
        self.u: B = None
        self.q: D = None
        self.v: C = None
        self.txt = txt

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

class C:
    def __init__(self, txt: str):
        self.u: G = None
        self.txt = txt

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

class E:
    def __init__(self, txt: str):
        self.v: G = None
        self.r: C = None
        self.w: A = None
        self.s: B = None
        self.txt = txt

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

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

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

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

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