class A:
    def __init__(self, txt: str):
        self.o: F = None
        self.w: B = None
        self.r: E = None
        self.u: H = None
        self.q: H = None
        self.x: D = None
        self.txt = txt

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.t: E = None
        self.r: E = None
        self.y: A = None
        self.z: E = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.u: B = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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

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

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

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

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

class F:
    def __init__(self, txt: str):
        self.t: C = None
        self.z: D = None
        self.w: C = None
        self.txt = txt

class G:
    def __init__(self, txt: str):
        self.w: H = None
        self.x: H = None
        self.t: E = None
        self.r: E = None
        self.y: A = None
        self.z: E = None
        self.q: H = None
        self.o: E = None
        self.txt = txt

class H:
    def __init__(self, txt: str):
        self.x: B = None
        self.w: B = None
        self.u: B = None
        self.t: B = None
        self.z: C = None
        self.txt = txt

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

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